home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
ronset21.zip
/
RONSET.DOC
< prev
next >
Wrap
Text File
|
1990-03-04
|
33KB
|
841 lines
RONSET
------
Batch file enhancer
Copyright (C) Ron Bemis 1990
All rights reserved
Version 2.1
I use DOS environment variables extensively, and I wanted a better way to
set and use them. I couldn't find it, so I wrote it myself. Here it is -
my idea of the ultimate batch file utility. It lets you set environment
variables to whatever you like... with brains. It does what DOS should
have done. This program is the equivalent of the internal DOS SET command,
but it's much more powerful. You can use it just like you use SET.
I hope you'll enjoy this program, and I also hope that you'll consider
sending in a registration if you like it. Please let me know if you find
something that doesn't work like you think it should. Also, please let me
know if you think of any enhancements for this program.
- Ron Bemis, FidoNet 124/1113, 214-213-3841
RONSET is shareware! That means that if you use it on a regular basis, you
must pay for it. You are hereby granted a limited licence to use this
program for a period of one month. At the end of this month, you must
either register this program or discontinue its use. This program may NOT
be used in a business, for-profit organization, or corporate environment
without first being registered. Registration price for this program is $20
per machine. Registrations should be mailed to:
Ron Bemis
9601 Forest Ln #222
Dallas, TX 75243
Happy batchin'!
By the time you're done playing with this program, you should understand
what the following line does and how it works:
RONSET fname=low(concat(hex(string(Net:,5)),hex(string(Node:,5))).REQ)
At least try each function by itself on the command line to see how they
work. Satisfy yourself that each function does work as you think it
should. I think there's about a zillion things you can do with this
program if you cut loose with the creative juices.
The above illustrates how you can "nest" RONSET commands to execute a number
of them at the same time and with respect to the same environment variable.
But we're gettin' ahead of ourselves, here.
COMMAND SYNTAX:
RONSET variable_name=function(parameters)
In which:
variable_name is replaced by the name of the environment variable you
want to create or replace;
function is any one of the many functions listed in this
documentation;
(parameters) are additional commands you give to RONSET. These commands
are dependent upon the function you have asked for.
All function parameters MUST be enclosed entirely within parenthesis as
shown above. In this documentaiton, the word "parameter" refers to whatever
it is you're enclosing within the parenthesis.
Arithmetic functions
--------------------
All arithmetic is done with floating point numbers.
add(addend,addend)
returns the sum of the two values
Example: Result:
RonSet Sum=add(15,32) SUM=47
sub(minuend,subtrahend)
returns the difference of the two values
Example: Result:
RonSet Diff=sub(19,25) DIFF=-6
mult(multiplicand,multiplier)
returns the product of the two values
Example: Result:
RonSet Prod=mult(15,32) PROD=480
div(dividend,divisor)
returns the quotient of the two values
Example: Result:
RonSet Quot=div(100,7) QUOT=14.2857
eq(x,y)
returns 1 if x is equal to y, 0 otherwise
Example: Result:
RonSet X=eq(5,6) X=0
RonSet X=eq(5,5) X=1
ne(x,y)
returns 1 if x is not equal to y, 0 otherwise
Example: Result:
RonSet X=ne(5,6) X=1
RonSet X=ne(5,5) X=0
lt(x,y)
returns 1 if x is less than y, 0 otherwise
Example: Result:
RonSet X=lt(5,6) X=1
RonSet X=lt(5,5) X=0
RonSet X=lt(6,5) X=0
le(x,y)
returns 1 if x is less than or equal to y, 0 otherwise
Example: Result:
RonSet X=le(5,6) X=1
RonSet X=le(5,5) X=1
RonSet X=le(6,5) X=0
gt(x,y)
returns 1 if x is greater than y, 0 otherwise
Example: Result:
RonSet X=gt(5,6) X=0
RonSet X=gt(5,5) X=0
RonSet X=gt(6,5) X=1
ge(x,y)
returns 1 if x is greater than or equal to y, 0 otherwise
Example: Result:
RonSet X=ge(5,6) X=0
RonSet X=ge(5,5) X=1
RonSet X=ge(6,5) X=1
abs(x)
returns the absolute value of x
Example: Result:
RonSet X=abs(-5) X=5
RonSet X=abs(10) X=10
RonSet X=abs(-2.3) X=2.3
mod(x,y)
returns x modulo y
Example: Result:
RonSet Rmn=mod(15,4) RMN=3
RonSet Rmn=mod(20,4) RMN=0
RonSet Rmn=mod(17,13) RMN=4
neg(x)
returns negative x
Example: Result:
RonSet Neg=neg(15) NEG=-15
RonSet Neg=neg(-7.3) NEG=7.3
sqr(x)
returns x squared
Example: Result:
RonSet Big=sqr(83) BIG=6889
RonSet Big=sqr(-100) BIG=10000
RonSet Big=sqr(23.5) BIG=552.25
sqrt(x)
returns the square root of x
Example: Result:
RonSet Root=sqrt(9) ROOT=3
RonSet Root=sqrt(8.7) ROOT=2.94958
pow(x,y)
returns x to the y power
this one is an exception to the rules about errorlevels
if invalid values are specified, a different type of error message (one
from the floating point run-time library) is displayed, and the program
may abort with an errorlevel other than 255.
Example: Result:
RonSet OneK=pow(2,10) ONEK=1024
RonSet Big=pow(7,5) BIG=16807
Binary functions
----------------
All binary functions are done with 16-bit unsigned numbers.
and(x,y)
returns the bitwise AND of x and y
Example: Result:
RonSet X=and(14,7) X=6
or(x,y)
returns the bitwise OR of x and y
Example: Result:
RonSet X=or(14,7) X=15
xor(x,y)
returns the bitwise XOR of x and y
Example: Result:
RonSet X=xor(14,7) X=9
not(x)
returns the 1's complement of x
Example: Result:
RonSet X=not(14) X=65521
hex(x)
returns the 4-digit hexidecimal equivalent of x
Example: Result:
RonSet X=hex(124) X=007C
RonSet X=hex(1113) X=0459
oct(x)
returns the 6-digit octal equivalent of x
Example: Result:
RonSet O=oct(29127) O=070707
RonSet O=oct(4096) O=010000
bin(x)
returns the 16-digit binary equivalent of x
Example: